<%@page import="java.util.List"%>
<%@page import="model.Category"%>

<%
    List<Category> categories = (List<Category>) session.getAttribute("categories");

    if (categories != null) {
        for (Category c : categories) {
            out.println("<div class='cCat'>");
            out.println("<a href='" + request.getContextPath() + "/category/" + c.getIdCategory() + "/" + c.getName().replaceAll(" ", "-") + "' title='" + c.getDescription() + "'>" + c.getName() + "</a>");
            out.println("</div>");

            List<Category> childCategories = c.getChildCategories();
            if (childCategories != null) {
                for (Category c2 : childCategories) {
                    out.println("<div class='cCatLv2'>");
                    out.println("<a href='" + request.getContextPath() + "/category/" + c2.getIdCategory() + "/" + c2.getName().replaceAll(" ", "-") + "' title='" + c2.getDescription() + "'>" + c2.getName() + "</a>");
                    out.println("</div>");
                }
            }
        }
    } else {
        response.sendRedirect(request.getContextPath() + "/home");
    }
%>

<div class="onlineSupport">
    <p style="font-family: cambria; font-weight: bold; font-size: 15px; color: black;">
        ONLINE SUPPORT
    </p>
    <div class="yahoo">
        Retail - Mr. Thai
        0945 555 135
        <a href="ymsgr:sendim?escape_2008v8&m=Welcome%20to%20Online%20Marketting%20System!">
            <img border="0" align="absmiddle" src="http://opi.yahoo.com/online?u=escape_2008v8&m=g&t=2&l=us" alt="Yahoo">
        </a>
    </div>
    <div class="yahoo">
        Help - Ms. Trang
        0982 396 012
        <a href="ymsgr:sendim?hippi_bhv&m=Welcome%20to%20Online%20Marketting%20System!">
            <img border="0" align="absmiddle" src="http://opi.yahoo.com/online?u=hippi_bhv&m=g&t=2&l=us" alt="Yahoo">
        </a>
    </div>
    <div class="facebook">
        <script>(function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id))
                    return;
                js = d.createElement(s);
                js.id = id;
                js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));
        </script>

        Like Us on Facebook
        <div class="fb-like" data-href="http://vozforums.com/" 
             data-width="128" data-height="32" data-colorscheme="light" 
             data-layout="button_count" data-action="like" data-show-faces="true" 
             data-send="false">
        </div>
    </div>
</div>
